package model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import play.db.jpa.GenericModel;

/**
 * The persistent class for the vehicle database table.
 * 
 */
@Entity
@Table(name = "vehicle")
public class Vehicle extends GenericModel implements Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1069288327780174321L;

	@Id
	public Long id;
	
	public Long hashid;

	public String busbrand;

	@Temporal(TemporalType.TIMESTAMP)
	public Date createtime;
	
	public String orgcode;

	public Integer rationseatnum;

	public Integer seatnum;

	@Temporal(TemporalType.TIMESTAMP)
	public Date updatetime;

	public String vehiclelvl;

	public String vehicleno;

	public String vehicletype;

	@Temporal(TemporalType.DATE)
	public Date factorydate;

	public String unitname;
	
	public String unitcode;
	public String status;
	public String certificatesno;
	@Temporal(TemporalType.DATE)
	public Date retiredate;
	@Temporal(TemporalType.DATE)
	public Date scrapdate;
	public String bustype;
	public String starlvl;

	public Vehicle(Long id, Long hashid, String busbrand, Date createtime,
			String orgcode, Integer rationseatnum, Integer seatnum,
			Date updatetime, String vehiclelvl, String vehicleno,
			String vehicletype, Date factorydate, String unitname,String unitcode,String status,
			String certificatesno,Date retiredate,Date scrapdate,String bustype, String starlvl) {
		super();
		this.id = id;
		this.busbrand = busbrand;
		this.createtime = createtime;
		this.orgcode = orgcode;
		this.rationseatnum = rationseatnum;
		this.seatnum = seatnum;
		this.updatetime = updatetime;
		this.vehiclelvl = vehiclelvl;
		this.vehicleno = vehicleno;
		this.vehicletype = vehicletype;
		this.factorydate = factorydate;
		this.unitname = unitname;
		this.hashid = hashid;
		this.unitcode = unitcode;
		this.status = status;
		this.certificatesno = certificatesno;
		this.retiredate = retiredate;
		this.scrapdate = scrapdate;
		//如果bustype为空则赋值为0
		if(bustype!=null && "1".equals(bustype)){
			this.bustype = "1";
		}else{
			this.bustype = "0";
		}
		this.starlvl = starlvl;
	}
	
	

}